Fixed bug 'config is not defined' at startup