Using sub products in conditional statement is not taking effect