Adding the $mainCourseCategory every where. see #7153