fix rewriting of page expr