added logics to fix nav hide and show when resize window