Fix foreign key error when deleting locations