Added ability to maintain STATE value between rhf and scheduler functions