added some logging; changed idd to iid