Fix notes from review
recover from really weird edge cases where db is clear but cache is not