is detach not a function in some case?