Corrected detach command behavior