passing config dir as parameter