added check for valgrind