Added better connection retry