replaced JS with JQuery