validator from hashref