title: localStorage commands stops the program
body: <p>Whenever i use save button and load button ( they work ) but stop the game. After I click load, the game freezes, buttons and animations work, but the game freezes and i cannot get xp or gold.</p>
  
  <p>my code:</p>
  
  <pre><code>function save(){
    localStorage["gold"] = gold;
    localStorage["goldmax"] = goldmax;
    localStorage["food"] = food;
    localStorage["foodmax"] = foodmax;
    localStorage["wood"] = wood;
    localStorage["woodmax"] = woodmax;
    localStorage["stone"] = stone;
    localStorage["stonemax"] = stonemax;
    localStorage["iron"] = iron;
    localStorage["ironmax"] = ironmax;
    localStorage["level"] = level;
    localStorage["xp"] = xp;
    localStorage["xpN"] = xpN;
    localStorage["xpgained"] = xpgained;
    localStorage["questpoint"] = questpoint;
    localStorage["questpointspeed"] = questpointspeed;
    localStorage["buildQueue"] = buildQueue;
    localStorage["buildSpeed"] = buildSpeed;
    localStorage["heroxp"] = heroxp;
    localStorage["herolevel"] = herolevel;
    localStorage["skillpoint"] = skillpoint;
    spop("Game has been successfully saved!")
  }
  function load(){
    if (localStorage.getItem("gold") === null){
      spop('&lt;strong&gt;Save file has been corrupted!&lt;/strong&gt;', 'error');
    }
    if (localStorage.getItem("gold") !== null){
      gold =            localStorage["gold"];
      goldmax =         localStorage["goldmax"];
      food =            localStorage["food"];
      foodmax =         localStorage["foodmax"];
      wood =            localStorage["wood"];
      woodmax =         localStorage["woodmax"];
      stone =           localStorage["stone"];
      stonemax =        localStorage["stonemax"];
      iron =            localStorage["iron"];
      ironmax =         localStorage["ironmax"];
      level =           localStorage["level"];
      xp =              localStorage["xp"];
      xpN =             localStorage["xpN"];
      xpgained =        localStorage["xpgained"];
      questpoint =      localStorage["questpoint"];
      questpointspeed = localStorage["questpointspeed"];
      buildQueue =      localStorage["buildQueue"];
      buildSpeed =      localStorage["buildSpeed"];
      heroxp =          localStorage["heroxp"];
      herolevel =       localStorage["herolevel"];
      skillpoint =      localStorage["skillpoint"];
      spop("Game has been successfully loaded!")
    }
  }
  </code></pre>