Fixed a bug in script.