declared pinMode(10,OUTPUT) before attempting to open SD card. closed SD card after finishing with initFile.