$state.go sometimes mistakes state for nested view in tabs controller

I have a tabbed view app. I have a couple views that sit outside of the tabs controller, one being ‘initial’. This is the first app view and contains the log in/sign up choice.

.state('initial', {
   url: '/initial',
  templateUrl: 'templates/initial.html',
  controller: 'initialCtrl'

Now, I have my settings view, which is a tab view with its own nested views

.state('tabsController.settings', {
   url: '/settings',
  views: {
   'tab4': {
      templateUrl: 'templates/settings.html',
      controller: 'settingsCtrl'

I have a ‘log out’ function in the settings controller which amongst other things like clearing cached user data, returns the user to the initial view:

$scope.doLogOut = function(){
        //deletes a few local storage values and then:

The problem I’ve got is that seemingly sporadically I’ll log in, then navigate to my settings tab, click logout and get booted back to ‘initial’, which is correct, but sometimes after that, clicking log in again will send me to my main page view but with a back button visible, as if it were a nested page of a tab view. I don’t want the user to be able to go “back” from a successful log in. What is happening here and why is it seemingly random?

EDIT: I have solved this issue by using $ionicHistory in my settings controller and clearing the history with $ionicHistory.clearHistory() before $state.go … Though it would be interesting to know why I have to do this if anyone knows?