Fix pages bug