fixed JS error in index