FIXED SCRIPTING ERRORS