add support for persistence
fix broken cherry-pick