fix nav bar conditional bug