add twid validation for ruby