Fix the command logic