fix javascript in main page