Fixed an error which prevented the script from running