Added state functionality to rules