added catch for before local storage key exists