fix PageMap so it properly handles subroutes