update for connect and disconnect