Ignore exception on closing the file writer
Added finalize methods for cleanup