added onReplaced listener