Added window load function to script file