fix file leak