Fix command execution check