Remove write_to_sd function