handelling the update of the record