fix bug in predict