wip: improving dirty cache detection