updated lifecycle callback example