moved out set timeseries events function out side