Having trouble fetching data from db.