added an option to retrieve the last written file path