                 print("FetchRequest failed with error: \(error.localizedDescription)")
             } catch {
                 fatalError()
+            }
+            
+            /* save change */
+            if context.hasChanges {
+                do {
+                    try context.save()
+                } catch let error as NSError {
+                    print("Save private context failed with error: \(error.localizedDescription)")
+                } catch {
+                    fatalError()
+                }
             }
         }
     }

            managedObject.setValue(modelName, forKey: kModelNameAttributeName)
            
            /* save */
            var saveError:NSError?
            if context.hasChanges {
                do {
                    try context.save()
                } catch let error as NSError {
                    saveError = error
                    print("Save private context failed with error: \(saveError!.localizedDescription)")
                } catch {
                    fatalError()
                }

    // MARK: - public methods
    public func fetchDataForModelName(modelName:String,cacheOnly:Bool ,success:((data:AnyObject?)->Void)?, failure:((error:NSError)->Void)?){
        /* fetch cached data */
        if let cachedData = fetchDataFromCoredataForModelName(modelName), successBlock = success {
            successBlock(data: cachedData)
        }
        /* apply policy */
