patients that were not initially loaded in the cohort caused errors
simplify mainhandler