fixed missing type check