Moved code of onUpdateContent