Added some javascript that doesn't work for state