add treatment to connect and disconnect callbacks