Added setNav function