fixed type check bug