Added better resilience to connection failures