fixed 100% CPU bug