some ugly hacks