Sorted problem of not waiting for goroutine to finish.