Added check for existing courses.