saving the messages into a local SQLite database