how to fix a bad script