added activity lifecycle management