changed getting of cn and n for ad