added validation checks for empty strings