added location validation