improved navbar behaviour