         
         var dataTypeRef: Unmanaged<AnyObject>?
         // Search for the keychain items
-        let status: OSStatus = SecItemCopyMatching(keychainQuery, &dataTypeRef)
+        let status: OSStatus = withUnsafeMutablePointer(&dataTypeRef) { SecItemCopyMatching(keychainQuery as CFDictionaryRef, UnsafeMutablePointer($0)) }
+
         if (status == errSecItemNotFound) {
             print("\(tokenType.rawValue) not found")
             return nil

        }
        set(value) {
            if let unwrappedValue = value {
                _ = self.keychain.save(self.accountId, tokenType: .ExpirationDate, value: unwrappedValue.toString())
            }
        }
    }

        }
        set(value) {
            if let unwrappedValue = value {
                self.keychain.save(self.accountId, tokenType: .AccessToken, value: unwrappedValue)
            }
        }
    }
