fix infinite script