fix 'variable may be used uninitialized' warning