returning if config is not defined since next line of code tries to use config