handle idempotency in a different way, to fix bug with parentheses