Added missing parts to get -set-state-status working