Fix the type check