some dirty type check hacks