added key validation on the constructor