 
   updateMinMaxHours : ->
 
-    @minMaxHours = {}
-    @getMinMaxHours()
+    @fetchPromise.done( =>
+      @minMaxHours = {}
+      @getMinMaxHours()
+    )
 
 
   updateSelectedTeam : ->

      data:
        start: start
        end: end
    ).done( => @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))
      workingTimes = _.pluck(selectedUsers, "workingTime")

      if _.isEmpty(workingTimes) then workingTimes = [0]

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

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