added validation to location