fix a bug in the script