added js on exit