Fixed bug in activity remove event