[Luis, Evgeny] add validations and set active key when adding a new key state