super-cautious code when handling writes in background task