         
         NSLog("Match failed with error: \(error.localizedDescription)")
         matchStarted = false
-        delegate.matchEnded()
+        delegate?.matchEnded()
     }
     
     // MARK: GKLocalPlayerListener

    
    var presentingViewController: UIViewController!
    var match: GKMatch!
    var delegate: GCHelperDelegate!
    var playersDict = [String:AnyObject]()
    var invitedPlayer: GKPlayer!
    var invite: GKInvite!

            return
        }
        
        delegate?.match(theMatch, didReceiveData: data, fromPlayer: playerID)
    }
    
    func match(theMatch: GKMatch!, player playerID: String!, didChangeState state: GKPlayerConnectionState) {
