bug fix of foreach(*.cfg)
updated using file from this repository