Fix CPU consumption bug