using database instead of localStorage