fixed lifecycle bug