Handles empty string as input