[CR]fix #6402

I don't know much about programing but this should work.