repetation in data paging

Hi, I’m getting data from database, first i retrieved a collection of 10 objects than i check if the list hot at the bottom getNextPage and add it to list array adapter, but if i have 24 total objects in database than after successfully retrieving 24 objects, when the list again hit the bottom, it adds the previous page data. it should return null but it keep returning the last page data. kindly help
here is the code of retrieving data objects when list hit the bottom
foundmessages is object of <BackendlessCollection<Messages>, that get first page
if (isAtBottom()) {
foundmessages.nextPage(new AsyncCallback<BackendlessCollection<Messages>>() {
@Override
public void handleResponse(BackendlessCollection<Messages> response) {
List<Messages> newList = response.getCurrentPage();
int size = response.getCurrentPage().size();
if (size< 0) {
Toast.makeText(getContext(), “No More Messages”, Toast.LENGTH_SHORT).show();
return;
}
else{
for (Messages message : newList) {
adapter.add(message);
}//forLoop
adapter.notifyDataSetChanged();
}//notNull-IfStatement
}//handleResponse

@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText(getContext(), “Sorry, error in retrieving new messages\n” + fault.getMessage(), Toast.LENGTH_LONG).show();
}
});

Thanks, it is solved. i was not updating the foundMessages object when i get the new page.

nextPage method must be called on a collection received on a previous step.
Not the one you get on the first step

//List&lt;Message&gt; messages = new ArrayList&lt;Message&gt;();
BackendlessDataQuery query = new BackendlessDataQuery(new QueryOptions(5, 0));
BackendlessCollection&lt;Message&gt; collection = Backendless.Data.of(Message.class).find(query);


while(collection.getData().size() > 0) {
    //messages.addAll(collection.getData());
    collection = collection.nextPage();
}