added foreignKey support