Added getstate.