made the thread wait 10ms after checking for connection so that it doesnt consume too much cpu