Add function to execute queries.