fixed bug with duplicated directory