added attach completed and detach completed events