fixing issue 24 - validate_string() allowing invalid strings