added conditional to course list loop