Fix the bug in the "run_query" function.