move reply handling into its own goroutine