moved js to js file