corrected cohorts function errors