 
         protected function registerAttributes(attributes:Array, attributeTypes:Array):void
         {
-            _registeredAttributes = _registeredAttributes.concat(attributes);
-            _registeredAttributeTypes = _registeredAttributeTypes.concat(attributeTypes);
+            _registeredAttributes = !_registeredAttributes ? attributes : _registeredAttributes.concat(attributes);
+            _registeredAttributeTypes = !_registeredAttributeTypes ? attributeTypes : _registeredAttributeTypes.concat(attributeTypes);
         }
 
         public function allowChange(attribute:String, oldValue:*, newValue:*):Boolean
         {
             /// Ako ne postoje observeri na ovaj atribut, odma vraca true
-            if (_attributeObservers[attribute] === undefined)
-            {
-                return true;
-            }
+            if (_attributeObservers[attribute] === undefined) return true;
 
             var targetObservers:Vector.<IObserver> = _attributeObservers[attribute];
             var length:int = targetObservers.length;
-            var observer:IObserver;
-            var i:int;
-
-            for (i = 0; i < length; i++)
-            {
-                observer = targetObservers[i];
+
+            for (var i:int = 0; i < length; i++)
+            {
+                var observer:IObserver = targetObservers[i];
                 if (observer.observedEvent == ManagedObjectEvent.ALLOW_CHANGE)
                 {
                     var observerEvent:ManagedObjectEvent = new ManagedObjectEvent(this, attribute, ManagedObjectEvent.ALLOW_CHANGE, oldValue, newValue);

                writeUnindentified(attributeName, this[attributeName], attributeType, serializator);
            }

            if (contextId)
            {
                writeUnindentified("id", contextId.objectId, "String", serializator);
            }
        }


        public function deserialize(deserializator:IDeserializator):void
        {

        public function ManagedObject()
        {
            _attributeObservers = new Dictionary();
//            _registeredAttributes = new Array();
//            _registeredAttributeTypes = new Array();
        }

        public function set contextId(contextId:ManagedObjectId):void
