moved JS to ext file