         
         let url = NSURL(string: "https://query.yahooapis.com/v1/public/yql?q=" +
             "select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(" +
-            "%22USD" + self.inputCurrency.code + "%2CUSD" + self.outputCurrency.code +
+            "%22USD" + currentInputCurrency + "%2CUSD" + currentOutputCurrency +
             "%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys")
         
         let task = NSURLSession.sharedSession().dataTaskWithURL(url!) {(data, response, error) in

            
            // Update UI on main thread.
            dispatch_async(dispatch_get_main_queue()) {
                NSNotificationCenter.defaultCenter().postNotificationName("CoinUpdatedNotification", object: nil, userInfo: ["currencyCode": self.inputCurrency.code, "currencyRate": fetchedInputRate])
                NSNotificationCenter.defaultCenter().postNotificationName("CoinUpdatedNotification", object: nil, userInfo: ["currencyCode": self.outputCurrency.code, "currencyRate": fetchedOutputRate])
                print("Updated input and output currency rates.")
            }
            

            let xml = SWXMLHash.parse(data!)
            
            do {
                fetchedInputRate = try xml["query"]["results"]["rate"].withAttr("id", "USD" + currentInputCurrency)["Rate"].element!.text!
                fetchedOutputRate = try xml["query"]["results"]["rate"].withAttr("id", "USD" + currentOutputCurrency)["Rate"].element!.text!
            } catch {
                print("Error fetching currencies: \(error)")
                hideActivityIndicator()
