Changed doc revision logic