Fix not deleting database for each time and avgdistance now is int and not NSNumber