added persistence code