How to detect out-of-sync condition