add first and last buttons for pagination and active state for current page