Bodge but it works AFAIK