attempt at fixing stub allocation bug