fixed navigation bug when attached to custom selector

Hi. I took the liberty to fix the problem where the navigation wasn't working properly if you used a custom selector.