       data:
         start: start
         end: end
-    ).done( => @updateMinMaxHours() )
+    )
+    @updateMinMaxHours()
 
 
   getMinMaxHours : ->
 
     # This function calculates the min/max working hours of the users of the selected team
     if _.isEmpty(@minMaxHours)
-      selectedUsers = _.filter(@model.get("userInfos"), (userInfo) => @doDrawUser(userInfo.user))
+      selectedUsers = _.filter(@model.get("userInfos"), (userInfo) => @team in _.pluck(userInfo.user.teams, "team"))
       workingTimes = _.pluck(selectedUsers, "workingTime")
 
       if _.isEmpty(workingTimes) then workingTimes = [0]

    TeamSelectionView = SelectionView.extend(
      teamChanged: =>
        @updateSelectedTeam()
        @paintGraph()
    )

    # sort the collection so the default team is the first one


  updateMinMaxHours : ->

    @fetchPromise.done( =>
      @minMaxHours = {}
      @getMinMaxHours()
    )


  updateSelectedTeam : ->
