Fix session id bug
Fix database persistence bug