Cleanup connection to SD