bugfix: cfg struct was initialized after setting a variable