Fixed infinite loop in case on finding snapshot