Bugfix when using local storage