Add support for unexpected connection termination