Trying to fix broken script