Fixed an error that crashed the game in some versions of Safari