added replace position auto define.
by FZD