Overriding detach instead of close