implement detach