recover the javascript function