Added functionality for adding a complex item