Adding entity type checking logic.