copied from thirdeye local