now the I/O resources are closed properly