Fix #6642

I'm not sure the change but I've tested it works.