fix compilation errors due to undefined variables