fix: count array of objects

Signed-off-by: Smita Kumari <kumarismita62@gmail.com>