messages saved to database