fix Valgrind uninitialized data issue