if else fix on first time local storage load when = undefined