fix bug: val -> num