adding type checking rules for identity type