         didSet{
             if let tasksGroups = selectedTasksGroups {
                  let indexes:[Int]=tasksGroups.map({ (tasksGroup) -> Int in
-                    return self.tasksGroups.indexOf(tasksGroup)!
+                    return self.tasksGroups.indexOf( { return $0.UID == tasksGroup.UID })!
                 })
                 self.registryMetadata.stateDictionary[BartlebyDocument.kSelectedTasksGroupsIndexesKey]=indexes
                 NSNotificationCenter.defaultCenter().postNotificationName(BartlebyDocument.TASKSGROUPS_SELECTED_INDEXES_CHANGED_NOTIFICATION, object: nil)

        didSet{
            if let lockers = selectedLockers {
                 let indexes:[Int]=lockers.map({ (locker) -> Int in
                    return self.lockers.indexOf(locker)!
                })
                self.registryMetadata.stateDictionary[BartlebyDocument.kSelectedLockersIndexesKey]=indexes
                NSNotificationCenter.defaultCenter().postNotificationName(BartlebyDocument.LOCKERS_SELECTED_INDEXES_CHANGED_NOTIFICATION, object: nil)

        didSet{
            if let users = selectedUsers {
                 let indexes:[Int]=users.map({ (user) -> Int in
                    return self.users.indexOf( { return $0.UID == user.UID })!
                })
                self.registryMetadata.stateDictionary[BartlebyDocument.kSelectedUsersIndexesKey]=indexes
                NSNotificationCenter.defaultCenter().postNotificationName(BartlebyDocument.USERS_SELECTED_INDEXES_CHANGED_NOTIFICATION, object: nil)
