fixed handling snapshot bug