fix condition race and fix back kill app