fix bug of the logic when command was executed.