Fixed using string from sessionStorage as integer