Fixed problem with not running script correctly