fixed handling of values
added timestamp (ts) to trend result