fix bug to save data to sqlite3