improved the update of the database