Fixed script not closing