#2 Fixed file store, changed writer to output stream