       newTab.active = true
     else if newTab.active
       self.select newTab
+    return
 
   self.removeTab = (tab) ->
     index = tabs.indexOf tab

  transclude: true
  replace:    true
  scope:
    active:   '@'
    src:      '@'
  compile: (element, attributes, transclude) ->
    postlink = (scope, element, attributes, controller) ->

      if tab.active and tab isnt selectedTab
        tab.active = false
        console.log tab
      return
    # Set the selected tab as active
    selectedTab.active = true
    return
