Fixed a bug in displaying pages