fixed db bug in messaging