update states sort