fix bug for BP