Changed close function to be async and to clear all channels before closing