fix bug in uninitialized variable