Hotfix for error handling in batch processing routine