retry connections three times before failing