add error handling for courses