Improve check for existing resource in indexer