Fix not closing file warning