modify process to close FileWriter