updated method for choosing files