update method for database