updated javascript cod for path