Fixed foreign key error