Implemented Try/Catch on Localstorage