added foreign check