added checks for sd card.