Update localstorage after deleting a key

The localStorage was not getting updated after deleting a key