fix pages bug