Fixed an error with the scripting