moved js to a external file