Fix bug for 'execute query'