generalized to ForeignKey class