Fixed pagination issue.

Fixed pagination issue when resultSet contains more number of records per page parameter