corrected js function parameters