Ugly hack but it works, now to make it work properly...