Fixed a file leak