adding conditional check for entity type in dynamic page generation.