fix access to uninitialized memory

thx, valgrind