persisting all data to database