added a query to check if patient already exists