saving the date on the db