Bug fix of predict