altered query_test to make it valgrind clean
make ui_state_test valgrind clean