Changed logic related to getting data.