Fixed javascript for sample.