Bug fix in batchWithData not checking the error