added the detach mode