added some validation for updating patient