fix a bug in script