created new js file for index page