fix a bug in a script