improving nav logic