config generation in recursively