reorder to aviod a foreign key issue