fix incorrectly passed foreign key