Linking to states in tabs

So I have looked into it more and have narrowed down the location of the issue a little more. It is in the ionicTabs controller. This controller starts at line 5143 in ionic-angular.js. The place where the problem seems to be occuring is at line 5173. For some reason the code is coming here to remove the current visible tab. The issue is that since there is more than one tab on the page the code executes the else in this block.

 if (tab.$tabSelected) {
  self.deselect(tab);
  //Try to select a new tab if we're removing a tab
  if (self.tabs.length === 1) {
    //do nothing if there are no other tabs to select
  } else {
    //Select previous tab if it's the last tab, else select next tab
    var newTabIndex = tabIndex === self.tabs.length - 1 ? tabIndex - 1 : tabIndex + 1;
    self.select(self.tabs[newTabIndex]);
  }
}

This is finding the right most tab on the screen and navigating to it. This normally would be a desired behaviour but since I am trying to move to a view that doesn’t contain the tab bar this is causing my application to not navigate as expected.