fixed pages length bug