fix get current page, return top path/file if not root