Fixed detach issue