before changing database for local storage