Fix query error in course by id