fix bug in smooth