Added detach device method