Fixing bug in script helper