Rewrite fix as it broke other tests. This fixes my issue and the broken tests.