bug fix for snapshotting code