sorting results by timestamp