changed if($config->Reports) to if($config)