Added a function to get the latest snapshot