added return for retrieving local storage
changed to javascript ifle