add snapshot function.