check is currentState exits before using it