fix for batch process
see also https://github.com/yiisoft/yii2/issues/5224