Fixed invalid page number bug