Integrated the addElement properly