moving js to layouts