Added the ability to save messages to the db and group up messages and save them all at once