fixed error in test (segfault from scope of chan)