fixed race and smoothed out result channel buffering problem