moved data saving to SQLite