Fixed bug that prevented script from running