catching errors in batch and propagating up