Add thread works with a very nasty hacking, needs tidying up