fixed file close