introduce detach
complete detaching
complete detaching part2
complete detaching part3
complete detaching part4
#20 fixed multiple same ids