fix: properly sort by timestamp