got reordering to pass valgrind