Conditional command execution fixed