fixed flakey problem when clicking directly on navbar links