added a small query debug option