Make thread to sleep when local-id overflows . But the (sleep 0.001) part may be problem.