Refixed foreign key bug from models