Works!

just add the filewriting function transmitted data succesfully