reconnect if connection is closed