 
 buildJSON = (blockData, mapOption, selectedMap) ->
   exportObj = {}
-  if !mapOption
+  if mapOption == '0'
     # if map option is zero, then we have to have a selected map
     exportObj.associatedMaps = [selectedMap]
   else


    # TODO: error handling
    $http.put("/item_sets/#{gon.itemSetId}/update_json", data)
  , true)

  # categorical filters are filtered

        # if there is no associated maps, then we can use
        # this item set for ANY maps, hence the mapOption is
        # set to 1
        $scope.mapOption = '1'
      else
        # if there is any associated maps, it means
        # we can only choose a specific map, and not any map
        # hence mapOption is set to 0
        $scope.mapOption = '0'
        $scope.selectedMap = gon.setData.associatedMaps[0]

      for itemBlock in gon.setData.blocks
