correct processing of exceptions in batch mode