fix valgrind check in slice mode