get messages from db