corrected getCurrentState() bugs