Added check for changes before firing replace