added enter and exit actions and rule state cache