implemented the get and set method for localStorage