ajax working to states index