Method for waiting till network is idle