corrected logical error in class_main.c error handling