checking foreign then function