fixed valgrind problem