js moved from index page to js file