Improve stability of background tasks