replaced cookie for localstorage functionality