put file close in finally block