Revise queried id check