moved rbw check whenever a state has been changed