updated the DAO implementation so that message creation and retrieval works correctly