prevent duplicate threads