Fixes an issue when a non-published page is shown on a menu