YH-597: add some conditionals