fix a script crash