Even with the previous check, there could still be a race condition where two collections with the same UID are created. Adding this extra check after will prevent that from happening.