Hacky fix for deactivation not working after MainActivty is destroyed.