finish YARN-502 patch