update js for Safari fix