separated navigation logic from showPopover