Fixed javaScript error