added missing type checking