bsp allocation bug fix