Fix build error caused by class variable

Refs #8198