Add the logic condition I missed out