updated read directory with the absolute path for saving the flatfile