Fix bug with currentState