update attach & detach