moved javascript from index to custom js file