save the data to the db