Added control for empty objects