Fixed the bugs, persistence now works