Exit if connection terminates