fixed the bug patient not being discharged