auto-detect active page