Gave up to be too clever and did something that works instead