added io loop