fixed selecting commands for removal logic to select first ones