create instance only when value is valid