fixed a legacy and unnoticed bug: have to use functions like parseInt() to parse integers stored in localStorage, since localStorage stores everything in string