Fix the foreign-key problem