update for foreign keys