implementation of local storage