Javascript Getscript Error Handling