Changed message fetching to fetch from DB