Add location function to diagnosis