conditional type checking