make inline validation more general, by passing in key name and key value