added associatedId code