getState to get state string