           $scope.oldItemSetBlocks = deepClone($scope.itemSetBlocks)
           $scope.hasChanged = false
         else
+          console.log('TODO: HANDLE ERRORS')
           console.log('error occured while trying to update')
     )
 

    oldString = JSON.stringify($scope.oldItemSetBlocks)
    currentString = JSON.stringify($scope.itemSetBlocks)

    console.log(JSON.stringify($scope.itemSetBlocks))
    console.log(JSON.stringify($scope.oldItemSetBlocks))

    if oldString != currentString
      console.log('is not equal')
      $scope.hasChanged = true
    else
      console.log('is equal')
      $scope.hasChanged = false

  , true)

  # this is called whenever apply changes is clicked
  $scope.updateItemSet = () ->
    obj = buildJSON($scope.itemSetBlocks, $scope.mapOption, $scope.selectedMap)
    data =
      authenticity_token: gon.authToken
      json: angular.toJson(obj)
