fixed type_exists bug"