Fix bug where alerts get stuck in background, halting the app