fixed detach error