minor bug in deBatch function.