fix minor bug

-add write2sd function.