Fixed after Andrew's review,
try-with-resource