add sample for attaching/detaching