     // TODO: this version is migrated from SONode
     // improve the implementation e.g. reuse the informarion form outRelationships
     public func outRelationshipTo(endNode: Node) -> Relationship? {
+        assert(context != nil, "No GraphContext available")
+        
         // read data
         var relationship:Relationship! = nil;
         var nextRelationshipID = outRelationshipID
         
         while (nextRelationshipID > 0) {
             
-            relationship = context.readRelationship(nextRelationshipID)
+            relationship = context!.readRelationship(nextRelationshipID)
             
             if (relationship.endNodeID == endNode.uid) {
                 return relationship;

            }
            
            // CONTEXT WRITE
            context.updateRelationship(relationship)
            
            //[outRelationships addObject:relationship];
            _outRelationships.append(relationship)

                var relationship = inRelationships.last
                
                if (relationship != nil) {
                    return context!.readNode(relationship!.startNodeID)
                }
            }

