fsm for env states