Made config dir available as a parameter.