Updated exists logic