add code for when a connection is been closed