fix sorted state in vector