rebuild only if dirty