seems to me this is overkill; see how I solved something very similar in 1edd63ab607d155aaeef7004c3dc12e31bb52782