what is the doctrine of waiver