Are you using it all in the same remote script file? Create a new file by going to File > New while in the script editor, then paste it there.