use channels to stop races