automaticaly close channels on error