fix check in markPairs