Add timestamp to query and fix preprocess return paths