Correction for loop wait for SDcard function.