js function to fix state prnom names