fixing leaks.
changes to findFile to have a reference parameter exists.