fixed error in script generator