reworked to prevent double thread jobs