pagination
fixed a bug in counting number of pages and rendering items to front page