improved goroutine control