fix for missing foreign_key