Changed logic of background worker