Need to close the file in a `defer`