Merge "Fix mutliple attach/detach issue"