fixed getByContest function