added get_query() function