Hello Dave,

I have modified the patch by your idea.
Please check.

  Thanks,
    Pan