Fix for 4608

Fix for https://github.com/yiisoft/yii2/issues/4608