fixing bug, config is out of scope here