add validate function and selectize