Fixes error on saving/getting to/from localstorage