reintroducing select to hopefully avoid a deadlock when there are too many channels