check map before close channel