fix compares in state trigger