changing script: bug fixes