try to defer done <- struct{}{}, maybe is the reason because at the end flush didn\'t work... maybe flush was interrupted because don channel was emptyed too fast