fixed onReplaced