fix bug about infinite