add some logic in navigation