correct error in exception classes
refactor exception handling