fix ANR and set CPU function (broken a long time ago)