Automatically sort by state