[fixed] valgrind warnings