fix for background thread