added helper function to get query string