                 return
             }
             
-            let predicate : NSPredicate = NSPredicate(format: "\(self.keyUserWhoMadePurchase) == %@", userRecordName)
+            let predicate : NSPredicate = NSPredicate(format: "\(self.keyUserWhoMadePurchase) == %@ ", userRecordName)
             let query : CKQuery = CKQuery(recordType: "Purchase", predicate: predicate)
             
             self.publicDatabase.performQuery(query, inZoneWithID: self.defaultRecordZone.zoneID, completionHandler: { (records : [CKRecord]?, error : NSError?) -> Void in

                let components : NSDateComponents = NSDateComponents()
                components.month = months
            
                expirationDate = self.gregorianCalendar?.dateByAddingComponents(components, toDate: date, options: .WrapComponents)
            }
        }
        

                        
                        // If there's an expiration date that's in the future, use that date as the purchase date.
                        if let fetchedExpirationDate = expirationDate {

                            if fetchedExpirationDate.timeIntervalSinceDate(purchaseDate) > 0 {
                                purchaseDate = fetchedExpirationDate
                            }
                            else
                            {
                               "The fetched expiry is in the past, keeping current date as starting point."
                            }
                        }
                        else {
                            print("Failed to fetch expiration date.")
                        }
                        
                        // Create a purchase
