Removed unnecessary conidtional from pagination