Fixed: copy config only when the directory is created
Fixed: use right variables