refactoring
fixed exception reporting