Setting the timeout channel outside the loop