injecting timer code on the javascript side