Change mode of script before running it