got cut to compile to nested selects, fixed bug in trace_store