This is one where there is an argument to say the law needs looking at. His second caution would have been for stopping a promising attack, but he didn't stop a promising attack as the referee played the advantage and the attack happened anyway. They didn't score here, but you could have the somewhat farcical situation where a player gets a second yellow for stopping a promising attack where a goal was scored.