close channel when exception happens
Merge pull request #1062 from nraychaudhuri/1044_handle_exception

close channel when exception happens