Hacked together fix. Not prettiest thing, but it works…