created function to get location string