fixed duplicate directory issue