use result chan instead of returning