add conditional checking to the generated commands