updated lifecycle handler