modification 2 for PR#5996