upload messages to database