Added support of replacing pages element with from and to elements