fixed a potential bug caused by an uninitialized variable