added event param to js function to prevent default on click