fix bug in predict2D