track events and localstorage if get error