Added AlertDialog, Fixed crash with BackgroundActivity