Update error handling

Add more error handling checks to course management class.