initialize mem to avoid valgrind warnings