fix AttachAgent#attach