fix obj iteration code