added defer/recover around output.Deliver() call