add connection termination listener