updated security for pagination and counts