Fixed the java script issues