adjust the directory of pearls, for multi-level directory