Update method for db