fix dug of extracting data from db