locations per directory instead of a global hash table to avoid memory leak issues, and incorrect results.