added JS code for statistics