Add another parameter to your function like getCurrency(currency,baseCurrency) and use that in your code and it should work.