imrpove performance of add directories recursively