add query to log transactions