moving js to layout file