Added debug js function.