Fixes an endless loop when displaying a child page without visible parent page