added attach detach