Fix for paging issue when page number is 'NaN'