differenciate between connection errors and prevent multiple loops