Fixed issue where the connection was not restarted when the connection
failed