updated the db update and insert.