fix bug in smooth term