added validation for location