use openFile function