adding segment js