put the loop in the connected section so we do not create and destroy thousands of connections