fixed a class typecheck bug