fix issue #28

I found two bugs:

1) the 'next' button would never get to the last page; and
2) the display of results didn't clear out the old results first.