Fixing wwwroot() JavaScript function