handle empty objects or arrays