fixed file close mistake