custom type checking