Fixed a crash caused by showing Toasts from a background task