tweaked navbar function