corrected foreign agent handling