improve exceptionhandling