added check for configfile existence to prevent panic