Fix 100% cpu usage