add preliminary support for persistence