Place the script into it's own file and change the order of your scripts such that this one is up top. In the remote editor go to File > Order to accomplish this. It could be that another script is interfering.