fixed writing data to file. boolean flag added to constructor filewriter(file, true)