allows the background worker to be cancelled on exiting application