Avoid memory leak in ConditionalCommand