# Not existing uid returns wrong document

**URL:** <https://community.prismic.io/t/not-existing-uid-returns-wrong-document/11442>\
**Category:** Developing with Prismic\
**Created:** [October 22, 2022, 5:54pm UTC](https://community.prismic.io/t/not-existing-uid-returns-wrong-document/11442 "2022-10-22T17:54:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prismic\_tymeo](https://avatars.discourse-cdn.com/v4/letter/p/6de8d8/32.png) [@prismic\_tymeo](https://community.prismic.io/u/prismic_tymeo)\
**Post date:** [October 22, 2022, 5:54pm UTC](https://community.prismic.io/t/not-existing-uid-returns-wrong-document/11442/1 "2022-10-22T17:54:27Z")

</div>

We have a uid `xyz` which equals our url path. This uid (with `getByUID`) returns a document with the uid `abc`. This uid `xyz` doesn't exist in our documents. We also cannot create a new document with the uid `xyz`.  
What's the issue?

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [October 24, 2022, 6:34pm UTC](https://community.prismic.io/t/not-existing-uid-returns-wrong-document/11442/3 "2022-10-24T18:34:15Z")

</div>

Hi @prismic_tymeo

Thanks for reaching out,

I believe that the document with UID "xyz" has been renamed to be "abc," and that is why when you query by the "xyz," you get the "abc" document.

You can't create a document with "xyz" UID, and that has been done why desgn to avoid breaking old URL.

You can release those UID by renaming the document that old UID and here is [trick](https://community.prismic.io/t/error-this-value-is-already-used-by-another-document/5465) to be able to use the old UID
