Fix paging.
Add modifications for pagination
Fix session.