moving JS to  external file