fix off by one error for unbuffered channels