some dirty fixes to make it work