added file opening