shell logic corrected use powerstate replace orgstate