added spec for custom page size, fixed small bug