open/close file in functions