fixed stub memory issue