added code to fetch by timestamp