add CPU removal detection and bugfixes