ensure the connection is reestablished after an error