logic for custom page headers