fix some bug for plan api