do we need a separate goroutine for this?