fixed persistence and uncaught json parsing error