fix reading files under the root tern director more than once
Merge pull request #3881 from dloverin/read-dir-fix

fix reading files under the root tern director more than once