Put message handling into its own function that runs as a goroutine