fix the pages bug