fixed crash when restarting background worker