Added error catching for background jobs