added null safety for config