Added update element function