fix 100% cpu usage bug