I'll write a longer comment on the PR, but this isn't going to do what you want... at least not correctly.