Fix check of route existence in top menu

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Todo: -
License of the code: MIT