now using db for persisting and retrieving data