Closing FileWriter after using it