add javascript back into layout template