now parsing message and setting state