 
             // create or update detail
 
-            userSkill.name = skill.name
-            userSkill.localName = skill.localName
-
-            if let coverURLString = skill.coverURLString {
-                userSkill.coverURLString = coverURLString
+            let _ = try? realm.write {
+                userSkill.name = skill.name
+                userSkill.localName = skill.localName
+                
+                if let coverURLString = skill.coverURLString {
+                    userSkill.coverURLString = coverURLString
+                }
             }
 
             if let skillCategory = skill.category, skillCategoryID = skill.category?.id {

        let skillID = skill.id
        var userSkill = userSkillWithSkillID(skillID, inRealm: realm)

        if userSkill == nil {
            let newUserSkill = UserSkill()
            newUserSkill.skillID = skillID

                }

                if let userSkillCategory = userSkillCategory {
                    let _ = try? realm.write {
                        userSkill.category = userSkillCategory
                    }
                }
            }
        }
