works with unbuffered channels