fix $ref and simply id