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

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

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


            // create or update detail

            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 {
