added write stream to file for temp storage