version with working persistence