                         }
                         
                         //found an animatable property - add the pending animation
-                        if currentKeyValue != nil {
+                        if let currentKeyValue = currentKeyValue {
                             activeContext.pendingAnimations.append(
                                 PendingAnimation(layer: layer, keyPath: key, fromValue: currentKeyValue)
                             )

        
        //run pending animations
        for anim in context.pendingAnimations {
            anim.layer.add(EA_animation(anim, context: context), forKey: nil)
        }
        

                        }
                        
                        //found an animatable property - add the pending animation
                        if let currentKeyValue = currentKeyValue {
                            activeContext.pendingAnimations.append(
                                PendingAnimation(layer: self, keyPath: key, fromValue: currentKeyValue
                                )
