throw fails when root or dir is not defined, make exclude empty by default