database fetching process improved. still some minor problems