fixed paginate bugs

fixed bug with links for previous pages in paginate