modified javascript & index