more satisfying fix for caseid bug