added check for location type