Should perhaps check that location.category == 'course' otherwise the course_id is not really the course_id