Changed logic to get latest snapshot