fixing bug whereby for an added element or removed element, the method will be called on the absent object, causing a NPE