added checking if patient exists