fix state tracking bug by giving precendence to running state