added logic to navButton rendering