run_query function

Run query