changed how to find contents and exclude directory