Handling the error when the course-list is unavailable

Yeah, now the code is more organized and readable. Thanx