Make connection attempt resilient

Try up to 3 times to connect