fixed small bug on runScript