add exception handling to classes