added user checking for person, patient