change to use nats on_error function.