fixed bug in the main page pagination