updated the connection termination to work with simul closing