script running on a separate thread