Fixed some bugs, typo, and secured session storage