check for location before manipulating strings with underscore