added definition for type-detect