fixed detach on free