fetching data from db into the ui