fix button counts for pagination controls