modify method to deal with a file