fix ‘Undefined variable’ warning