fix bug around lifecycle