[OE-3471] fixed race condition that caused a crash in the patient controller.