Clean stop when receive stop signals. TODO: wait goroutine