Fixed script bug