minor fixes
fix bug: missing file close