make page name determination more robust