proper resource cleanup using IOUtils