Added Thread.sleep() when stopping to avoid any possible concurrent modification