Nasty hack, but it now sort of works