trying to handle errors in class definition
handling class definition and body errors