Fixed bug when only one page