issue #174: fixed key validation