Added currentState. Parse incoming data