writing data to file synchronously and asynchronously...