updated associatedId code