fixed some scripting errors