add close file handler