Fixed obvious bug in script