added emit_payload option