moving getting stock data to separate function