pagination done.
fix a little bugs.