added checks for location