fixed stub allocation bug